maximize profit function subject to the constraint